package edu.pku.sei.modeler.editparts;

import org.eclipse.draw2d.IFigure;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.editpolicies.DirectEditPolicy;

import edu.pku.sei.modeler.edit.parts.AbstractNodeEditPart;
import edu.pku.sei.modeler.editpolicies.UMLDiagramGraphicalNodeEditPolicy;
import edu.pku.sei.modeler.editpolicies.UMLNodeEditPolicy;
import edu.pku.sei.modeler.model.structure.MetaNode;
import edu.pku.sei.modeler.model.structure.MetaShapeElement;

public class AbstractUMLNodeEditPart extends AbstractNodeEditPart {

	public AbstractUMLNodeEditPart(MetaShapeElement model) {
		super(model);
	}

	@Override
	protected DirectEditPolicy createDirectEditPolicy() {
		return null;
	}

	@Override
	protected IFigure createFigure() {
		return null;
	}

	@Override
	protected void createEditPolicies() {
		super.createEditPolicies();
		installEditPolicy(EditPolicy.COMPONENT_ROLE, new UMLNodeEditPolicy());
		installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
				new UMLDiagramGraphicalNodeEditPolicy(((MetaNode) getModel())
						.getDiagram().getType()));
	}

}
